package com.wuchao.single;

/**
 * @Author wuchao66
 * @Date 2023/10/23 14:07
 * @PackageName:com.wuchao.single
 * @ClassName: HurrySingle
 * @Description: TODO
 * @Param
 * @Version 1.0
 */
public class HurrySingle {//饿汉
    //1只能有一个人能调到真正的我，其他人都是吊别人用过的
    //1构造函数私有化
    private HurrySingle(){}
    //2直接实例化
    private static HurrySingle hurrySingle=new HurrySingle();
    //3你要保证只有一个人能调到第一次的真我‘
    public synchronized static HurrySingle getInstance(){
        return  hurrySingle ;
    }
}
